<template>
  <view>
    <view class="section-title">简历海报</view>
    <view class="poster-box" id="posterBox">
      <image :src="resume.avatar" class="avatar" />
      <view class="name">{{resume.name}} · {{resume.age}}岁</view>
      <view class="job">{{resume.job}}</view>
      <view class="desc">{{resume.desc}}</view>
    </view>
    <button class="save-btn" @click="savePoster">保存到相册</button>
  </view>
</template>
<script>
export default {
  data() {
    return {
      resume: {
        name: '', age: '', job: '', desc: '', avatar: ''
      }
    }
  },
  onLoad() {
    const resume = uni.getStorageSync('resume');
    if (resume) this.resume = resume;
  },
  methods: {
    savePoster() {
      // 简单实现：截图保存整个页面（实际项目建议用canvas绘制更美观）
      uni.showToast({ title: '请使用截图功能保存', icon: 'none' });
    }
  }
}
</script>
<style>
.section-title { margin: 32rpx 20rpx 12rpx 20rpx; font-size: 30rpx; font-weight: bold; color: #333; }
.poster-box { background: #fff; border-radius: 16rpx; box-shadow: 0 2rpx 8rpx #f0f1f2; padding: 40rpx 20rpx; display: flex; flex-direction: column; align-items: center; margin: 20rpx; }
.avatar { width: 120rpx; height: 120rpx; border-radius: 50%; margin-bottom: 20rpx; }
.name { font-size: 32rpx; font-weight: bold; margin-bottom: 8rpx; }
.job { font-size: 28rpx; color: #2d8cf0; margin-bottom: 8rpx; }
.desc { font-size: 24rpx; color: #888; text-align: center; }
.save-btn { background: #2d8cf0; color: #fff; border: none; border-radius: 8rpx; padding: 16rpx 0; font-size: 28rpx; margin: 30rpx 20rpx; }
</style> 